/*
 * @(#)MaintSysUserDefinedIndexDetailForm.java
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */
package com.dcivision.framework.web;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;

import com.dcivision.framework.ApplicationException;
import com.dcivision.framework.TextUtility;
import com.dcivision.framework.bean.AbstractBaseObject;
import com.dcivision.framework.bean.SysUserDefinedIndexDetail;

/**
  MaintSysUserDefinedIndexDetailForm.java

  This class is the for web form purpose.

  @author      Zoe Shum
  @company     DCIVision Limited
  @creation date   14/07/2004
  @version     $Revision: 1.4 $
*/

public class MaintSysUserDefinedIndexDetailForm extends AbstractActionForm {

  public static final String REVISION = "$Revision: 1.4 $";

  private String userDefinedID = null;
  private String fieldName = null;
  private String mandatory = null;
  
  private String valueSuggest = null;
  
  private String fieldType = null;
  private String reference = null;
  private String sqlStat = null;

  public MaintSysUserDefinedIndexDetailForm() {
    super();
  }

  public String getUserDefinedID() { 
    return(this.userDefinedID);
  }

  public void setUserDefinedID(String userDefinedID) { 
    this.userDefinedID = userDefinedID;
  }

  public String getFieldName() { 
    return(this.fieldName);
  }

  public void setFieldName(String fieldName) { 
    this.fieldName = fieldName;
  }

  public String getMandatory() { 
    return(this.mandatory);
  }

  public void setMandatory(String mandatory) { 
    this.mandatory = mandatory;
  }

  public String getFieldType() { 
    return(this.fieldType);
  }

  public void setFieldType(String fieldType) { 
    this.fieldType = fieldType;
  }

  public String getReference() { 
    return(this.reference);
  }

  public void setReference(String reference) { 
    this.reference = reference;
  }

  public String getSqlStat() { 
    return(this.sqlStat);
  }

  public void setSqlStat(String sqlStat) { 
    this.sqlStat = sqlStat;
  }
  public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
    return super.validate(mapping, request);
  }

  public void reset(ActionMapping mapping, HttpServletRequest request) {
    super.reset(mapping, request);
    this.setID(null);
    this.setUserDefinedID(null);
    this.setFieldName(null);
    this.setMandatory(null);
    
    this.setValueSuggest(null);
    
    this.setFieldType(null);
    this.setReference(null);
    this.setSqlStat(null);
    this.setRecordStatus(null);
    this.setUpdateCount(null);
    this.setCreatorID(null);
    this.setCreateDate(null);
    this.setUpdaterID(null);
    this.setUpdateDate(null);
  }

  public AbstractBaseObject getFormData() throws ApplicationException {
    SysUserDefinedIndexDetail tmpSysUserDefinedIndexDetail = new SysUserDefinedIndexDetail();
    tmpSysUserDefinedIndexDetail.setID(TextUtility.parseIntegerObj(this.getID()));
    tmpSysUserDefinedIndexDetail.setUserDefinedID(TextUtility.parseIntegerObj(this.getUserDefinedID()));
    tmpSysUserDefinedIndexDetail.setFieldName(this.getFieldName());
    tmpSysUserDefinedIndexDetail.setMandatory(this.getMandatory());
    
    tmpSysUserDefinedIndexDetail.setValueSuggest(this.getValueSuggest());
    
    tmpSysUserDefinedIndexDetail.setFieldType(this.getFieldType());
    tmpSysUserDefinedIndexDetail.setReference(this.getReference());
    tmpSysUserDefinedIndexDetail.setSqlStat(this.getSqlStat());
    tmpSysUserDefinedIndexDetail.setRecordStatus(this.getRecordStatus());
    tmpSysUserDefinedIndexDetail.setUpdateCount(TextUtility.parseIntegerObj(this.getUpdateCount()));
    tmpSysUserDefinedIndexDetail.setCreatorID(TextUtility.parseIntegerObj(this.getCreatorID()));
    tmpSysUserDefinedIndexDetail.setCreateDate(parseTimestamp(this.getCreateDate()));
    tmpSysUserDefinedIndexDetail.setUpdaterID(TextUtility.parseIntegerObj(this.getUpdaterID()));
    tmpSysUserDefinedIndexDetail.setUpdateDate(parseTimestamp(this.getUpdateDate()));
    return tmpSysUserDefinedIndexDetail;
  }

  public void setFormData(AbstractBaseObject baseObj) throws ApplicationException {
    SysUserDefinedIndexDetail tmpSysUserDefinedIndexDetail = (SysUserDefinedIndexDetail)baseObj;
    this.setID(TextUtility.formatIntegerObj(tmpSysUserDefinedIndexDetail.getID()));
    this.setUserDefinedID(TextUtility.formatIntegerObj(tmpSysUserDefinedIndexDetail.getUserDefinedID()));
    this.setFieldName(tmpSysUserDefinedIndexDetail.getFieldName());
    this.setMandatory(tmpSysUserDefinedIndexDetail.getMandatory());
    
    this.setValueSuggest(tmpSysUserDefinedIndexDetail.getValueSuggest());
    
    this.setFieldType(tmpSysUserDefinedIndexDetail.getFieldType());
    this.setReference(tmpSysUserDefinedIndexDetail.getReference());
    this.setSqlStat(tmpSysUserDefinedIndexDetail.getSqlStat());
    this.setRecordStatus(tmpSysUserDefinedIndexDetail.getRecordStatus());
    this.setUpdateCount(TextUtility.formatIntegerObj(tmpSysUserDefinedIndexDetail.getUpdateCount()));
    this.setCreatorID(TextUtility.formatIntegerObj(tmpSysUserDefinedIndexDetail.getCreatorID()));
    this.setCreateDate(formatTimestamp(tmpSysUserDefinedIndexDetail.getCreateDate()));
    this.setUpdaterID(TextUtility.formatIntegerObj(tmpSysUserDefinedIndexDetail.getUpdaterID()));
    this.setUpdateDate(formatTimestamp(tmpSysUserDefinedIndexDetail.getUpdateDate()));
  }

	public String getValueSuggest() {
		return valueSuggest;
	}

	public void setValueSuggest(String valueSuggest) {
		this.valueSuggest = valueSuggest;
	}
}
